home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / EnterCD 01_2004.iso / Multimedia / Advanced Effect Maker Freeware Edition 1.0 / aemf10.exe / {app} / templates / verticalscroller.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2002-10-12  |  3.9 KB  |  109 lines

  1. function initApplet()
  2. {
  3.    setProperty("moviearea", _X, 0);
  4.    setProperty("moviearea", _Y, 0);
  5.    setProperty("expiredapplet", _visible, false);
  6.    var today = new Date();
  7.    trace(today.getTime());
  8.    if(today.getTime() < ts && ts < today.getTime() + 172800000 || ts == -1)
  9.    {
  10.       activated = true;
  11.    }
  12.    else
  13.    {
  14.       setProperty("expiredapplet", _visible, true);
  15.    }
  16.    if(activated)
  17.    {
  18.       maxsize = getProperty("moviearea.scrollertext", _height);
  19.       currenttextpos = height;
  20.       setProperty("moviearea.scrollertext", _X, 0);
  21.       setProperty("moviearea.scrollertext", _Y, height);
  22.       var tc = new Color("moviearea.scrollertext");
  23.       tc.setRGB(textcolor);
  24.       if(usesidefade)
  25.       {
  26.          var color = new Color("fade");
  27.          color.setRGB(backgroundcolor);
  28.          var sw = int(sidefadeheight / 10);
  29.          var originalscaley = fade._yscale;
  30.          var originalscalex = fade._xscale;
  31.          fade._yscale = originalscaley * sw;
  32.          fade._xscale = int(originalscalex * (width / fade._width));
  33.          var i = 0;
  34.          while(i < 10)
  35.          {
  36.             fade.duplicateMovieClip("fade" + i * 2,i * 2);
  37.             setProperty("fade" + i * 2, _Y, sw * i);
  38.             setProperty("fade" + i * 2, _X, 0);
  39.             setProperty("fade" + i * 2, _alpha, 100 - i * 10);
  40.             fade.duplicateMovieClip("fade" + (i * 2 + 1),i * 2 + 1);
  41.             setProperty("fade" + (i * 2 + 1), _Y, height - sw * i);
  42.             setProperty("fade" + (i * 2 + 1), _X, 0);
  43.             setProperty("fade" + (i * 2 + 1), _alpha, 100 - i * 10);
  44.             i++;
  45.          }
  46.       }
  47.    }
  48.    else
  49.    {
  50.       setProperty("moviearea.scrollertext", _visible, false);
  51.    }
  52. }
  53. function run()
  54. {
  55.    if(activated && !finished)
  56.    {
  57.       if(dragging)
  58.       {
  59.          currenttextpos += - lasty + this._ymouse;
  60.          lasty = this._ymouse;
  61.       }
  62.       setProperty("moviearea.scrollertext", _Y, currenttextpos);
  63.       point = new object();
  64.       point.x = this._xmouse;
  65.       point.y = this._ymouse;
  66.       localToGlobal(point);
  67.       if(!dragging)
  68.       {
  69.          currenttextpos -= scrollerspeed;
  70.       }
  71.       if(currenttextpos + maxsize < 0)
  72.       {
  73.          currenttextpos = height;
  74.          if(runonce == 1)
  75.          {
  76.             finished = true;
  77.             if(0 < nextmovie.length())
  78.             {
  79.                loadMovie(nextmovie,_level0);
  80.             }
  81.          }
  82.       }
  83.    }
  84.    if(mousedown)
  85.    {
  86.       mousedown = false;
  87.    }
  88. }
  89. var currenttextpos = 0;
  90. var maxsize = 0;
  91. var mousedown = false;
  92. var dragging = false;
  93. var lasty = -1;
  94. var maxitems = 0;
  95. var activated = false;
  96. var finished = false;
  97. var runonce = parseInt("0",10);
  98. var nextmovie = "";
  99. var width = parseInt("200",10);
  100. var height = parseInt("100",10);
  101. var fontsize = parseInt("14",10);
  102. var textcolor = parseInt("0",10);
  103. var backgroundcolor = parseInt("16711680",10);
  104. var scrollerspeed = parseInt("1",10);
  105. var sidefadeheight = parseInt("30",10);
  106. var usesidefade = parseInt("1",10);
  107. var ap = "<APPLETINFO>\r\nappletname=verticalscroller\r\nappletfilename=verticalscroller1\r\ncreated=1016439424080\r\n</APPLETINFO>\r\n<ACTIONSCRIPT>\r\nwidth=200\r\nheight=100\r\nscrollerspeed=1\r\nsidefadeheight=30\r\nfontsize=14\r\ntarget=_self\r\nnextmovie=\r\ntextcolor=0\r\nbackgroundcolor=16711680\r\nrunonce=0\r\nusesidefade=1\r\n</ACTIONSCRIPT>\r\n<HTML>\r\nwidth=200\r\nheight=100\r\n</HTML>\r\n<GENERATED>\r\nwidth=200\r\nheight=100\r\nfontsize=14\r\nfontsize_GS=4;-\r\nfont=_arial\r\nfont_GS=3;-\r\nscrollertext_GS=2;font;fontsize;alignment;0\r\nscrollertext=With the verticalscroller|applet you write a text|and the applet will scroll|it upwards.|You can click and drag|the text with the mouse.|You also have the option |to use the side fading|and to select your own|color and font.|\r\nalignment_GS=5;-\r\nalignment=0;\r\nbackgroundcolor=ff0000\r\n</GENERATED>";
  108. var ts = parseInt("-1",10);
  109.